package com.vans.micro.user.service.impl;

import com.vans.micro.user.entity.UserInfo;
import com.vans.micro.user.mapper.UserInfoMapper;
import com.vans.micro.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import user.UserInfoVO;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author QXY
 * @since 2020-10-24
 */
@Service
public class UserInfoInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoMapper mapper;

    @Override
    public UserInfoVO getById(Integer id) {
        UserInfo user = mapper.selectById(id);
        return toVO(user);
    }

    private UserInfoVO toVO(UserInfo user) {
        UserInfoVO userVO = new UserInfoVO();
        userVO.setId(user.getId());
        userVO.setName(user.getName());
        return userVO;
    }
}
